//----------------------------------------------------------------
#ifndef PLAYER_H
#define PLAYER_H
//----------------------------------------------------------------
#include "Common.h"
#include "Base.h"
#include "Miner.h"
#include <map>
#include <vector>
//----------------------------------------------------------------
class World;
class Scene;
class A;
//----------------------------------------------------------------
class Player
{
public:
	Player(World* pkWorld, Scene* pkGameScene, Importer* pkImporter, A* pkPathfinder);
	~Player();

	void setResourceAmount(ResourceList kResType, int iAmount);
	int getResourceAmount(ResourceList kResType);
	void addResourceAmount(ResourceList kResType, int iAmount);
	bool addBase(int iPosX, int iPosY);
	bool addMiner(int iPosX, int iPosY);
	void giveMinerCommand(size_t iMinerIndex, Miner::MinerActions kAction);
	bool getNearestBase(vector<int>& rkPath, int iMinerPosX, int iMinerPosY);

	void update(float fTimeBetweenFrames);

protected:
	int* m_piResourceAmount;
	World* m_pkWorld;
	Scene* m_pkGameScene;
	Importer* m_pkImporter;
	typedef map<pair<int, int>, Base*>::iterator BaseIterator;
	map<pair<int, int>, Base*> m_kBases;
	//vector<Miner*> m_kMiners;
	vector<Miner*> m_kMinersVector;
	A* m_pkPathfinder;
};
//----------------------------------------------------------------
#endif //PLAYER_H
//----------------------------------------------------------------
